#!/usr/bin/env python

import wx
import sys
import component

import resource as r

class Names(component.ListCtrl):
    '''Names class
    
    @author Julot <andy.julot@gmail.com>
    @since Thursday, February 23, 2012. 12:31 PM'''
    
    def __init__(self, parent):
        style = wx.LC_REPORT | wx.LC_SINGLE_SEL
        component.ListCtrl.__init__(self, parent, style=style)
        self.InsertColumn(1, r.string.view.contacts.name)
        self.SetColumnWidth(0, wx.LIST_AUTOSIZE)

    @property
    def values(self):
        return None
    
    @values.setter
    def values(self, values):
        self.DeleteAllItems()
        for value in values:
            index = self.InsertStringItem(sys.maxint, value.name)
            self.SetItemData(index, value.id)
